06. Naming Conventions

Naming Conventions

Object Naming Conventions

User object

Given the following user object, what would you use to print the value of the email property?

var user = {
  email: "user@example.com",
  firstName: "first",
  lastName: "last"
};
SOLUTION:
  • console.log(user.email);
  • console.log(user["email"]);

Car Object

Select the piece of code that creates an object that describes a red Honda Civic:

SOLUTION:
  • var car = { manufacturer: "honda", model: "civic", class: "compact", color: "red" };
  • var car = { color: "red" , manufacturer: "honda", model: "civic", class: "compact" };